package com.apps.order.utils;

import cn.hutool.core.util.RandomUtil;

import java.text.SimpleDateFormat;
import java.util.Date;

public class OrderUtils {

    /**
     * 生成一个不重复的交易流水号
     */
    public static String TransactionNo()
    {
        String ss=   new SimpleDateFormat("yyyyMMdd") .format(new Date() );
        String dd = new SimpleDateFormat("HHmmssSSS").format(new Date());
        return ss+ RandomUtil.randomNumbers(2)+RandomUtil.randomNumbers(2)+dd+RandomUtil.randomNumbers(2)+RandomUtil.randomNumbers(2);
    }
}
